package chpt03;

import java.util.Objects;

public class ObjectsTest {

	public static void main(String[] args) {
		Person p = null;
		p = Objects.requireNonNullElse(p, new Person());
		System.out.println(p.id);

	}

	public static void testObjects(String str) {
		String result;
		// if (str == null){
		if (Objects.isNull(str)) {
			result = "str为空";
		} else {
			result = "str为" + str;
		}

		System.out.println(result);
	}

}
